Preserve raw bytes in IMAP APPEND#109
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62fdff5430
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
afb5f56 to
6c71a13
Compare
…d-raw-bytes # Conflicts: # HaskellNet.cabal # test/IMAPParsersTest.hs
Combines mailbox quoting from master (PR qnikst#108) with raw byte preservation in IMAP APPEND. Updated test expectations to match the new appendFull implementation (bsPut + len = BS.length mailData). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
@qnikst thanks for merging all the previous PRs already :) is this one good to go as well? |
Owner
|
This one is good to go as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #102.
appendFullcurrently splits the rendered message withBS.lines, computes a new literal size from those split lines, and sends each line withbsPutCrLf. That mutates already-rendered RFC 5322/MIME bytes: CRLF input becomes CRCRLF on the wire and the literal size no longer matches the original message size.This PR keeps the public API unchanged and sends the APPEND literal exactly as supplied:
BS.length mailDatamailDatais written once withbsPutRegression coverage:
IMAP.append conn "INBOX" "Subject: x\r\n\r\nBody\r\n"sends the exact raw message bytes after the APPEND command.Before the fix, the new regression failed with
{23}and doubled carriage returns. After the fix it passes with{20}and unchanged message bytes.Validation:
nix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal test imap-parsers --test-show-details=directnix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal build allnix shell nixpkgs#cabal-install nixpkgs#ghc --command cabal check(only the existingCHANGELOGdoc-place warning remains)git diff --checkNote: this includes the same
imap-parserstest-target setup andhttps://repository metadata fix as the other small upstream PRs because the branch is independently based on upstreammaster. It can be rebased to drop that overlap after the first test-target PR merges.